import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/',
    redirect: '/hall' // 重定向
  },
  {
    path: '/hall',
    component: () => import('@/views/Hall.vue')
  },
  {
    path: '/gaming',
    component: () => import('@/views/InGame.vue')
  },
  {
    path: '/gameSelf',
    component: () => import('@/views/GameSelf.vue')
  },
  {
    path: '/:pathMatch(.*)*', // 匹配所有未定义路由
    name: 'NotFound',
    component: () => import('@/views/NotFound.vue')
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
